Ext.namespace("Project.Main");

Project.Main = function(){
	
	var flag="";
		 //访问action
	 var conn = new Ext.data.Connection({
	    url:'../security/checkMenu.form?timesnap=' + Date.parse(new Date()),
	    method:'post'
	 })
	 var param={menuName:"grgzt"};
	  //alert(Ext.util.JSON.encode(param));  
	 Utils.request(conn,{
	    params:param,
	    scope:this,
	    success:function(data){
	     if(data.access=="true"){
	      flag="true"
	      		 //原始代码开始
	      		 var mainPanel = new Ext.TabPanel( {
					activeTab : 0,
					width : 950,
					border : false,
					layoutOnTabChange:true,
					renderTo : 'main',
					closable:true,
					autoScroll:true,
					items : [ {
						title : '公司数据库',
						autoHeight : true,
						activeTab: 0, 
						listeners: {activate: handleActivate},
						items : [ new Draft().beforeSell ],
						//html:'<iframe id="iframe1" src="'+url+'" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>',
						//./project/customer.html
						//html:'../project/customer.html'
						html:'../haojin/project/customer.html'
					},{
						title : '个人数据库',
						autoHeight : true,
						listeners: {activate: handleActivate},
						
						items : [ new CreateInfo().createPanel ]
					},
					{
						title : '已联系数据',
						autoHeight : true,
						items : [ new ISconnect().connect ]
					},
					{
						title : '潜在数据',
						autoHeight : true,
						items : [ new PotentialCust().potential ]
					},
					{
						title : '明确数据',
						listeners: {activate: handleActivate},
						autoHeight : true,
						items : [ new ISsure().sure ]
					},
					{
						title : '客户下放',
						autoHeight : true,
						items : [ new UnVise().uvPanel ]
					}]
					
				});
				//原始代码结束
	     }else{
	      flag="false"
	      alert("没有权限");
	      return;
	     }
	
	    }
	  });
	
	

		//{
		//	title : '客户共享',
		//	autoHeight : true,
		//	items : [ new customerShare().customerSharePanel ]
		//},
		//	{
		//	title : '客户转移',
		//	autoHeight : true,
		//	items : [ new customerMove().customerMovePanel ]
		//}
		//],
		//	listeners: {'tabchange': function(tb,newtab) {
				//alert(newtab.title + ' was activated.');
			//	alert('请将扫描商品，放入顺丰物流公司外包装，                                   配发单号：PFD-03-“2011-01-12”-001');
			//	alert('成功！');
			//	alert('请将扫描商品，放入“3-13-1”货位的物流外包装');
			//	window.confirm('是否完成装袋操作','系统提示');	
			//	alert('存在错误');
			//	alert('放于3-12-1库位');	
				//Ext.getCmp(newtab.id).getActiveTab().load();
            
		
	//);
	
	function handleActivate(tab){
		 //[tab.id].location.reload();    
//        alert(tab.title + ' was activated.');
//      tab.items.beforeSell.customerStore.load();
		}
};

	
	Ext.onReady(function(){
		 Ext.QuickTips.init();
		 Ext.form.Field.prototype.msgTarget = 'side';
		 Ext.BLANK_IMAGE_URL = '../resources/images/default/s.gif';
		 new Project.Main();
	});